package com.heima.handler;


import com.heima.pojo.vo.LoginUserVo;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;


@RestControllerAdvice
public class GlobalExceptionHandler {

    @ExceptionHandler(Exception.class)
    public LoginUserVo handleException(Exception e) {
        e.printStackTrace(); // 开发期打印
        return LoginUserVo.fail("系统错误：" + e.getMessage());
    }
}